


package(default_visibility = ["//visibility:public"])

config_setting(
    name = "darwin",
    values = {"cpu": "darwin"},
    visibility = ["//visibility:public"],
)

config_setting(
    name = "linux",
    values = {"cpu": "linux"},
    visibility = ["//visibility:public"],
)


LINKOPTS = [
    "-lpthread",
    "-ldl",
] + select({
    ":darwin": [
        "-framework CoreFoundation",
        "-framework CoreGraphics",
        "-framework CoreData",
        "-framework CoreText",
        "-framework Security",
        "-framework Foundation",
        "-Wl,-U,_MallocExtension_ReleaseFreeMemory",
        "-Wl,-U,_ProfilerStart",
        "-Wl,-U,_ProfilerStop",
        "-Wl,-U,_RegisterThriftProtocol",
    ],
    "//conditions:default": [
      "-lrt",
    ],
})

ABEL_SRC = glob(["**/*.cc",
                 "**/**/*.cc",
                 ]
                 )

cc_library(
    name = "abel",
    srcs = ABEL_SRC,
    hdrs = glob(["**/*.h", "**/*.inc"]),
    linkopts = LINKOPTS,
    copts =  ["-std=c++17"]
             )